package leetcode.code542.Matrix01;

import leetcode.helper.HelpDebug;

public abstract class Matrix01 implements IMatrix01 {

	@Override
	public void debug1() {
		// 输入：mat = [[0,0,0],[0,1,0],[0,0,0]]
		// 输出：[[0,0,0],[0,1,0],[0,0,0]]
		int[][] input = new int[][] { { 0, 0, 0 }, { 0, 1, 0 }, { 0, 0, 0 } };
		int[][] expect = new int[][] { { 0, 0, 0 }, { 0, 1, 0 }, { 0, 0, 0 } };
		HelpDebug.printInputs(expect, new Object[] { input });
		int[][] result = this.updateMatrix(input);
		HelpDebug.printObject(result);
	}

	@Override
	public void debug2() {
		// 输入：mat = [[0,0,0],[0,1,0],[1,1,1]]
		// 输出：[[0,0,0],[0,1,0],[1,2,1]]
		int[][] input = new int[][] { { 0, 0, 0 }, { 0, 1, 0 }, { 1, 1, 1 } };
		int[][] expect = new int[][] { { 0, 0, 0 }, { 0, 1, 0 }, { 1, 2, 1 } };
		HelpDebug.printInputs(expect, new Object[] { input });
		int[][] result = this.updateMatrix(input);
		HelpDebug.printObject(result);

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub
		int[][] input = new int[][] { { 1, 1, 1, 1, 1, 1 }, { 1, 0, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1 },
				{ 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 0, 1, 1 }, { 1, 1, 1, 1, 1, 1 },
				{ 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 1, 0 }, { 0, 1, 1, 1, 1, 1 } };
		HelpDebug.printInputs("", new Object[] { input });
		int[][] result = this.updateMatrix(input);
		HelpDebug.printObject(result);

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub
		int[][] input = new int[][] { { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 },
				{ 1, 1, 1, 1, 0, 0, 0, 1, 1, 0 }, { 1, 1, 1, 1, 1, 1, 0, 0, 1, 0 }, { 1, 0, 0, 1, 1, 1, 0, 1, 0, 1 },
				{ 0, 0, 1, 0, 0, 1, 1, 0, 0, 1 }, { 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 }, { 1, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
				{ 0, 0, 1, 1, 1, 1, 0, 1, 1, 1 }, { 1, 1, 0, 0, 1, 0, 1, 0, 1, 1 } };
		HelpDebug.printInputs("", new Object[] { input });
		int[][] result = this.updateMatrix(input);
		HelpDebug.printObject(result);

	}



	@Override
	abstract public int[][] updateMatrix(int[][] mat);

}
